package com.xkdx.guangguang.fragment.user;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.http.entity.mime.content.FileBody;

import android.graphics.Bitmap;
import android.os.Environment;

import com.xkdx.guangguang.module.network.AbsAction;

public class UserLoginTencentAction extends AbsAction {

	private String qQOpenID, qQToken, qQExpireTime, userNickName, userSex,
			userBirthday, userEmail, userMobilePhone, deviceSN, deviceModel,
			oSVersion;

	
	public UserLoginTencentAction(String qQOpenID, String qQToken,
			String qQExpireTime, String userNickName, String userSex,
			String userBirthday, String userEmail, String userMobilePhone,
			String deviceSN, String deviceModel, String oSVersion) {
		this.qQOpenID = qQOpenID;
		this.qQToken = qQToken;
		this.qQExpireTime = qQExpireTime;
		this.userNickName = userNickName;
		this.userSex = userSex;
		this.userBirthday = userBirthday;
		this.userEmail = userEmail;
		this.userMobilePhone = userMobilePhone;
		this.deviceSN = deviceSN;
		this.deviceModel = deviceModel;
		this.oSVersion = oSVersion;
		key =3;
		fileBody = new FileBody(new File(Environment.getExternalStorageDirectory() + "/GuangGuang/user/head.jpg"));
	}

	@Override
	public void constructRequest() {

		// 获取手机号

		HashMap<String, String> qqloginmap = new HashMap<String, String>();
		qqloginmap.put("DeviceID", "2");
		qqloginmap.put("RegionID", "D0101");
		qqloginmap.put("QQOpenID", qQOpenID);
		qqloginmap.put("QQToken", qQToken);
		qqloginmap.put("QQExpireTime", qQExpireTime);
		qqloginmap.put("UserNickName", userNickName);
		qqloginmap.put("UserSex", userSex);
		qqloginmap.put("UserBirthday", userBirthday);
		qqloginmap.put("UserEmail", userEmail);
		qqloginmap.put("UserMobilePhone", userMobilePhone);
		qqloginmap.put("DeviceSN", deviceSN);
		qqloginmap.put("DeviceModel", deviceModel);
		qqloginmap.put("OSVersion", oSVersion);

		String loginJson = constructJson(qqloginmap);

		Parameter parameter = new Parameter("userInterface", "qqLogin",
				loginJson);
		List<Parameter> list = new ArrayList<Parameter>();
		list.add(parameter);

		requestData = constructMod(list);
	}
}
